int state; // the stup fuction runs once when you press reset or power the board void setup() { // initialize digitalpin LED_BUILTIN as an output pinMode (D0,OUTPUT); pinMode (D7,OUTPUT); pinMode (D6,OUTPUT); pinMode (D1, INPUT); } // the loop function runs over and over again forever void loop(){ // this line gets the value of Pin D1 inside state variable state=digitalRead(D1); if(state==HIGH) { digitalWrite(D0,HIGH); digitalWrite(D7,HIGH); digitalWrite(D6,HIGH); } else{ digitalWrite(D0,LOW); digitalWrite(D7,LOW); digitalWrite(D6,LOW); } }